package cn.mw.cmdb.service.impl;

import cn.mw.microMonitorCommon.api.cmdb.AlertWeightConfigInfo;
import cn.mw.microMonitorCommon.api.cmdb.InstanceTopoServerApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
@Slf4j
public class InstanceTopoServerApiImpl implements InstanceTopoServerApi {

    @Autowired
    private InstanceToPoServiceImpl instanceToPoService;

    @Override
    public List<AlertWeightConfigInfo> getAlertWeightConfigInfosByInstanceId(String instanceId) throws Exception {
        return instanceToPoService.getAlertWeightConfigInfosByInstanceId(instanceId);
    }

    @Override
    public boolean updateInstanceHealth(String instanceId, Double healthCount) {
        return instanceToPoService.updateInstanceHealth(instanceId, healthCount);
    }
}
